<%+cbi/valueheader%>
<script type="text/javascript">
//<![CDATA[
function import_file_name(btn, option, file_path) {
		var file_name = prompt("<%:Paste the name of the new file (including the extension) here:%>", "");
		if (file_name == null || file_name == "") {
			return false;
		}
		XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "create_file")%>', {filename: file_name, filepath: file_path}, function(x, status) {
			if (x && x.status == 200)
			{
				location.reload();
			}
		});
	}
	//]]>
</script>
<input type="button" class="btn cbi-button cbi-button-apply" value="<%:Create File%>" onclick="return import_file_name(this, '<%=self.option%>', '<%=self.value%>')" />
<%+cbi/valuefooter%>
